<?php
/**
 * XGPHP 轻量级PHP框架
 * @link http://xgphp.xg3.cn
 * @version 2.0.0
 * @license http://www.apache.org/licenses/LICENSE-2.0
 * @author 讯高科技 <xungaokeji@qq.com>
*/
namespace xg;
use \xg\facade\View;
use \xg\facade\Response;

class Module
{
	protected $view=null;
	protected $sys=null;
 	public function __construct() {
		$response=$this->init();
		if($response){
			$response->done();
		}
	}
	protected function init(){}
 	protected function display($tpl='',$data=[]) {
		$cont = $this->fetch($tpl,$data);
		return Response::create($cont);
	}
 	protected function fetch($tpl='',$data=[]) {
		if(is_array($tpl)){
			$data=$tpl;
			$tpl='';
		}
		return View::fetch($tpl,$data);
	}
 	protected function assign($name,$value='') {
		return View::assign($name,$value);
	}
}
?>